package com.projects.candientu;

import java.util.List;

import android.app.ListActivity;
import android.os.Bundle;

import com.projects.candientu.adapters.DataAdapter;
import com.projects.candientu.utils.DataProvider;
import com.projects.candientu.utils.RowData;

public class MainActivity extends ListActivity {
	private DataProvider provider;
	private List<RowData> data;

	// Use an existing ListAdapter that will map an array
	// of strings to TextViews
	@Override
	public void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
        loadData();
	}
	
	private void loadData() {
		// Init data
		provider = new DataProvider();
		data = provider.loadAllData(this);
		DataAdapter adapter = new DataAdapter(this, R.layout.dataitem,
				R.id.lblSTT, data);
		setListAdapter(adapter);
		getListView().setTextFilterEnabled(true);
	}
}